#include <websocketpp/config/asio_no_tls_client.hpp>
#include <websocketpp/client.hpp>

typedef websocketpp::client<websocketpp::config::asio_client> client;

int main() {
    client c;

    std::string uri = "ws://localhost:9002";

    c.init_asio();
    c.set_message_handler([](websocketpp::connection_hdl, client::message_ptr msg) {
        std::cout << "Received: " << msg->get_payload() << std::endl;
    });

    websocketpp::lib::error_code ec;
    client::connection_ptr con = c.get_connection(uri, ec);
    c.connect(con);

    c.run();
}